/**
 * 仪表板路由
 * 提供系统概览、统计数据和监控功能
 */

const express = require('express');
const router = express.Router();
const dashboardController = require('../controllers/dashboard.controller');
const { authorize } = require('../middleware/permission.middleware');

/**
 * GET /admin/dashboard/overview
 * 获取系统概览数据
 */
router.get('/overview', authorize(['superadmin', 'admin']), dashboardController.getOverview);

/**
 * GET /admin/dashboard/statistics
 * 获取系统统计数据
 */
router.get('/statistics', authorize(['superadmin', 'admin']), dashboardController.getStatistics);

/**
 * GET /admin/dashboard/users
 * 获取用户相关统计数据
 */
router.get('/users', authorize(['superadmin', 'admin']), dashboardController.getUserStatistics);

/**
 * GET /admin/dashboard/usage
 * 获取系统使用情况统计
 */
router.get('/usage', authorize(['superadmin', 'admin']), dashboardController.getUsageStatistics);

/**
 * GET /admin/dashboard/performance
 * 获取系统性能指标
 */
router.get('/performance', authorize(['superadmin', 'admin']), dashboardController.getPerformanceMetrics);

/**
 * GET /admin/dashboard/alerts
 * 获取系统警报列表
 */
router.get('/alerts', authorize(['superadmin', 'admin']), dashboardController.getAlerts);

/**
 * GET /admin/dashboard/recent-activities
 * 获取最近活动日志
 */
router.get('/recent-activities', authorize(['superadmin', 'admin']), dashboardController.getRecentActivities);

/**
 * GET /admin/dashboard/health
 * 获取系统健康状态
 */
router.get('/health', authorize(['superadmin', 'admin']), dashboardController.getHealthStatus);

module.exports = router;